<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/jspcommon.jsp"%>

<!-- <div id="lx_company_test"></div>
<input type="text" id="company">
<div id="lx_company"></div> -->

<div style="position: relative;">
	<div class="l-text-wrapper">
		<div class="l-text l-text-combobox">
			<input type="text" id="companyName" name="companyName" class="l-text-field" value="${artArtist.schoolName }" style="height: 20px;">
			<input type="hidden" id="company" name="company" class="l-text-field" value="${artArtist.schoolid }" >
		</div>
	</div>
	<div class="l-box-select l-box-select-absolute" style="width: 200px; cursor: e-resize; left: 0; top: 23px; display: none;" id="lx_company_div">
		<div class="l-box-select-inner">
			<table cellpadding="0" cellspacing="0" border="0" class="l-box-select-table l-table-nocheckbox" id="lx_company">
			</table>
		</div>
	</div>
</div>

<script language="javascript">
<!--
	
	//联想公司名称
	function lxCompany() {
		var name = $.trim($("#companyName").val());
		$("#lx_company_test").html(name);
		if (name == "") {
			$("#lx_company").html("");
			return;
		}
		$.post("/misc/company/lxCompany.htm", {
			name : name
		}, function(data) {
			if(data.length>0){
				$("#lx_company_div").css("display","block");
			}
			$("#lx_company").html("");
			$.each(data, function(i) {
				$("#lx_company").append("<tr><td align='left' onclick='clickCompanyName(this,"+data[i].id+")'>"+data[i].name + "</td></tr>");
			});
		}, 'json');
	}
	//点击公司名称事件
	function clickCompanyName(self,id){
		$("#companyName").val($(self).text());
		$("#company").val(id);
		$("#lx_company").html("");
		$("#lx_company_div").css("display","none");
	}
	//给公司名称文本框绑定事件
	if (/msie/i.test(navigator.userAgent)) {
		//ie浏览器
		$("#companyName").onpropertychange = lxCompany;
	} else {
		//非ie浏览器，比如Firefox
		document.getElementById('companyName').addEventListener("input",
				lxCompany, false);
	}
//-->
</script>